package com.tmxk.employee.dao.impl;

import com.tmxk.employee.dao.TTripModeDao;
import com.tmxk.employee.pojo.entity.TTripMode;
import com.tmxk.employee.utils.BaseDao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 出行方式实现类
 */
public class TTripModeDaoImpl  extends BaseDao implements TTripModeDao {
    public List<TTripMode> queryAllMode(Map<String, Object> map) {
        List<TTripMode> modeList = new ArrayList<>();
        TTripMode mode = null;
        StringBuffer sql = new StringBuffer();
        sql.append(" SELECT ID,NAME FROM T_TRIP_MODE ");
        super.rs = super.executeQuery(sql.toString());
        try {
            while (rs.next()) {
                mode = new TTripMode();
                mode.setId(rs.getInt("ID"));
                mode.setName(rs.getString("NAME"));
                modeList.add(mode);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            super.closeAllConn(conn, pstmt, rs);
        }
        return modeList;
    }

    public int addMode(TTripMode mode) {
        return 0;
    }

    public int updateMode(TTripMode mode) {
        return 0;
    }

    public int deleteMode(String id) {
        return 0;
    }
}
